home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 909 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.2 KB

  1. From: moacs11!walra@relay.nl.net (Waldi Ravens)
  2. Subject: Re: Path length in GEM file selector
  3. Date: Thu, 20 Jan 1994 14:56:10 +0100
  4.  
  5. In <9401201204.AA13974@urix6.uni-muenster.de>, Marcus Haebler wrote:
  6.  
  7. > there is a little problem with the path length in GEM programs if
  8. > you use the normal length of 128 Bytes, this is quite small for
  9. > Minix FSs etc. Should we set path length to 1024 like BSD does?
  10.  
  11. Since P1003.1 does not define a maximum length for a path, no application
  12. should assume that there is one. You'll have to use something more
  13. flexible than a compile time constant.
  14.  
  15. Here is an example with getcwd() :
  16.  
  17. #define PATHSIZE 1024
  18.  
  19. char *cwdname(void)
  20. {
  21.         int     size = PATHSIZE;
  22.         char *  name;
  23.  
  24.         while(1)
  25.         {       name = (char *) malloc(size);
  26.                 if( name = NULL )
  27.                         FatalError("out of memory");
  28.                 if( getcwd(name, size-1) != NULL )
  29.                         return name;
  30.                 if( errno != ERANGE )
  31.                         FatalError("getcwd() failed");
  32.                 free(name);
  33.                 size += PATHSIZE;
  34.         }
  35. }
  36.  
  37.  
  38. Regards,
  39.            Waldi  (walra%moacs11@nl.net)
  40.